// 取出来调用后端接口的地址
import { API_CONFIG } from "../config/index.js";
import request from "../api/index.js";
// 在很多位置，都可能用到同一个接口, data: {}
export const getIngressListHandler = (data) => {
    return request(API_CONFIG.getIngressListApi, data, "get", "2000")
}

export const getIngressClassListHandler = (data) => {
    return request(API_CONFIG.getIngressClassListApi, data, "get", "2000")
}

export const deleteIngressHandler = (clusterId, namespace, name) => {
    return request(API_CONFIG.deleteIngressApi, {clusterId, namespace, name}, "post", "2000")
}
// 
export const createIngressHandler = (data) => {
    return request(API_CONFIG.createIngressApi, data, "post", "2000")
}

export const updateIngressHandler = (data) => {
    return request(API_CONFIG.updateIngressApi, data, "post", "2000")
}

export const getIngressDetailHandler = (data) => {
    return request(API_CONFIG.getIngressApi, data, "get", "2000")
}

export const getIngressTopologyHandler = (data) => {
    return request(API_CONFIG.getIngressTopologyApi, data, "get", "5000")
}